import fetch from 'common/src/utils/fetch';

/**
 * 根据条件，查询选课规则
 */
export function getTemplateList(data) {
    return fetch({
        url: '/api/electionservice/electionTpl/tplList',
        method: 'post',
        data: data
    });
}

export const getTemplateListUrl = '/api/electionservice/electionTpl/tplList';

/**
 * 新增
 */
export function addElecTemplate(data) {
    return fetch({
        url: '/api/electionservice/electionTpl/add',
        method: 'post',
        data: data
    });
}
/**
 * 修改参数状态
 */
export function updateElecTemplate(data) {
    return fetch({
        url: '/api/electionservice/electionTpl/update',
        method: 'post',
        data: data
    });
}

/**
 * 停用/启用选课方案模板
 */
export function updateElecTemplateStatus(data) {
    return fetch({
        url: '/api/electionservice/electionTpl/updateStatus',
        method: 'post',
        data: data
    });
}

/**
 * 删除
 */
export function deleteElecTemplates(data) {
    return fetch({
        url: '/api/electionservice/electionTpl/delete',
        method: 'post',
        data: data
    });
}

/**
 * 选课方案模板
 */
export function getElecTemplateDeatil(id, managerDeptId) {
    return fetch({
        url:
            '/api/electionservice/electionTpl/getTpl?id=' +
            id +
            '&managerDeptId=' +
            managerDeptId,
        method: 'post'
    });
}
